﻿<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">
                    <img src="http://placehold.it/150x50&text=Logo" alt="">
                </a>
            </div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav navbar-right">
				<?php 
				session_start();
				if (!isset($_SESSION['id'])) { ?>
                <li>
					<a href="./dangnhap.php" >Đăng nhập</a>
				</li>
				<li>
					<a href="./dangky.php" >Đăng kí</a>
				</li>
				<?php }
				else { 
					$id = intval($_SESSION['id']);
                    $squery = $conn->query("SELECT * FROM users WHERE id='{$id}'");
                    $member = mysqli_fetch_array($squery);
					echo '<li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" title="Bootstrap Related Resources" aria-expanded="false">Chào '.$member['lname'].'!<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="./capnhat.php"><i class="fa fa-list fa-fw"></i>Thay đổi thông tin cá nhân</a>
                        </li>
                        <li>
                            <a href="./DoiPass.php"><i class="fa fa-desktop fa-fw"></i>Đổi mật khẩu</a>
                        </li>
                    </ul>
                </li>';
					if ($member['group_id'] == "1"){
					
				?>
				<li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" title="Bootstrap Related Resources" aria-expanded="false">Control Panel<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="./danhsachcv.php"><i class="fa fa-list fa-fw"></i>Danh sách công việc</a>
                        </li>
                        <li>
                            <a href="./ThemCongViec.php"><i class="fa fa-desktop fa-fw"></i>Thêm Công việc</a>
                        </li>
						<li>
                            <a href="./ListUsers.php"><i class="fa fa-desktop fa-fw"></i>Danh sách người dùng</a>
                        </li>
						<li>
                            <a href="./DanhsachNganh.php"><i class="fa fa-desktop fa-fw"></i>Danh sách Ngành nghề</a>
                        </li>
                    </ul>
                </li>

				<?php } ?>
				<li>
					<a href="./dangxuat.php" >Đăng xuất</a>
				</li>
				<?php } ?>
			</ul>
            </div>
        </div>
    </nav>